package com.lb.lambda;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;

/**
 * @ClassName StreamApiDemo
 * @Author hp
 * @Date 2021/6/15 22:53
 * @Version 1.0
 **/
public class StreamApiDemo {
        private static List<String> list = Arrays.asList("asd","asddsa","ewr","sfdfds","sdhf","ldflgjhdfl54456456");
    @Test
    public void test(){
        List<String> list = Arrays.asList("aa","dd","kk","lkkl");
        Stream<Character> characterStream = list.stream().flatMap(e -> getList(e));
    }

    public static Stream<Character> getList(String str){
        List<Character> list = new ArrayList<>();
        for (char c : str.toCharArray()) {
            list.add(c);
        }
        return list.stream();
    }
}
